package com.quanshu.exchange.support.db.core;


import com.quanshu.exchange.support.utils.AppUtils;
import com.quanshu.exchange.ui.base.MyApplication;

public class DBController {
    private static DBController instance;
    private OrmDBHelper mDBHelper;

    private DBController() {
        mDBHelper = new OrmDBHelper(MyApplication.getInstance(),
                MyApplication.getInstance().getCurrentUser().getMemberid(),
                AppUtils.getVersionCode(MyApplication.getInstance()));
    }

    public static DBController getInstance() {
        if (instance == null) {
            instance = new DBController();
        }
        return instance;
    }

    public OrmDBHelper getDB() {
        return mDBHelper;
    }

    public static void reset() {
        if (instance != null) {
            instance = null;
        }
    }

}
